Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor DigitalContactTracingSweep #417

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

DavidVernest
Copy link
Contributor

@DavidVernest DavidVernest commented Jun 23, 2020

Refactor the DigitalContactTracingSweep function in Sweep.cpp.

Specifically, extract four functions:

  1. static void GetDctStartEndTimes(int infector, int contact, unsigned short contact_time, unsigned short& dct_start_time,
    unsigned short& dct_end_time);

  2. void AddToDctQueue(int tn, int ad, int i3, int ci, unsigned short ts);

  3. static void RemoveFromDctQueue(int j, int i, int k, int contact, int infector, unsigned short contact_time);

  4. static void RemoveContactFromDctQueue(int contact);

@zlatanvasovic
Copy link
Contributor

Maybe this should be moved out of Sweep.cpp? The file is quite large, so it may be useful to break it down.

@DavidVernest
Copy link
Contributor Author

@zdroid Yes - plans are afoot to break both Sweep.cpp and Update.cpp into separate files/classes. But not in this PR - to keep things simpler for the reviewers, I have not broken up these files.

@DavidVernest DavidVernest marked this pull request as draft June 24, 2020 11:46
@DavidVernest
Copy link
Contributor Author

@weshinsley @dlaydon @matt-gretton-dann Is Digital Contact Tracing actively used? If so, do we have any regression tests for it? It might not be worth refactoring otherwise - and I'll move on to something else. Thanks.

@DavidVernest
Copy link
Contributor Author

@weshinsley Hi - can I just confirm if Digital Contact Tracing is actively used? I can unit test and simplify the code - just looking to see if it is active before asking for a merge request.

@dlaydon
Copy link
Collaborator

dlaydon commented Jun 30, 2020

Hi @mstevens-uk, thanks for asking. We are using this code right now, but it isn't added to the formal regression tests. Therefore if you could refrain from changing or refactoring it for now that would be helpful. Thanks.

@DavidVernest
Copy link
Contributor Author

Understood.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants